func getAnn(n int) int {
	result := 1
	for i := 1; i <= n; i++ {
		result *= n
	}
	return result
}

func permutation(nums []int) [][]int {
	var result [][]int = make([][]int, 0)
	// 对简单情况进行罗列
	if len(nums) == 0 {
		return result
	} else if len(nums) == 1 {
		result = append(result, nums)
		return result
	} else if len(nums) == 2 {
		if nums[0] == nums[1] {
			result = append(result, nums)
			result = append(result, nums)
			return result
		} else {
			result = append(result, nums)
			var nums_new []int = []int{nums[1], nums[0]}
			result = append(result, nums_new)
			return result
		}
	}
	// 对于更长的序列,先排序
	for i := 0; i < len(nums)-1; i++ {
		for j := i + 1; j < len(nums); j++ {
			if nums[i] > nums[j] {
				nums[i], nums[j] = nums[j], nums[i]
			}
		}
	}
	// 不重复的排列组合--删除重复项
	result = append(result, nums)
	for i := 0; i < getAnn(len(nums))-1; i++ {
		var nums_new []int = make([]int, 0)

	}
	return result
}